package lines.gameengine.util;

import lines.gameengine.FieldPoint;
import lines.gameengine.ICell;
import lines.gameengine.IField;

import java.util.ArrayList;
import java.util.List;

/**
 * @author vpotapenko
 */
public class LinesEngineUtils {

    public static List<FieldPoint> getEmptyCells(IField field) {
        List<FieldPoint> points = new ArrayList<FieldPoint>();
        for (int x = 0; x < field.getWidth(); x++) {
            for (int y = 0; y < field.getHeight(); y++) {
                final ICell cell = field.getCell(x, y);
                if (cell.isEmpty()) points.add(cell.getPoint());
            }
        }
        return points;
    }
}
